package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.CloudVendor;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 
 * 云供应商Dao接口
 * 
 * @author DZG
 * @since V1.0 2016年9月5日
 */
public interface CloudVendorDao extends GenericDao<CloudVendor, Long> {

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<CloudVendor> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 查询所有
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<CloudVendor> listAll() throws Exception;

	/**
	 * 查询云供应商简易列表
	 * 
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the bean
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 删除供应商
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean delete(Long id, Long userId) throws Exception;

	/**
	 * 锁定供应商
	 * 
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public boolean lock(Long id, Long userId) throws Exception;

	/**
	 * 激活供应商
	 * 
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public boolean active(Long id, Long userId) throws Exception;

	/**
	 * 查询供应商数量
	 * 
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 
	 * 获取供应商信息
	 * 
	 * @return
	 * @throws Exception
	 */
	public CloudVendor query(Long id) throws Exception;

	/**
	 * 根据名称查询
	 * 
	 * @param username（账号）
	 * @return
	 * @throws Exception
	 */
	public CloudVendor getByName(String name) throws Exception;

	/**
	 * 根据地址查询
	 * 
	 * @param address
	 * @return
	 * @throws Exception
	 */
	public CloudVendor getByAddress(String address) throws Exception;

}
